package com.bw.ppjokeplay.mvvm.model.home

import com.bw.ppjokeplay.commen.entity.BaseEntity
import com.bw.ppjokeplay.commen.mvvm.model.BaseModel
import com.bw.ppjokeplay.commen.network.Api
import com.bw.ppjokeplay.commen.network.ApiServer
import com.bw.ppjokeplay.mvvm.model.entity.AddCommentsEntity
import com.bw.ppjokeplay.mvvm.model.entity.CommentsEntity
import com.bw.ppjokeplay.mvvm.model.entity.HomeFeedEntity
import io.reactivex.Observable
import retrofit2.http.Query

/**
 * @author Lishaohe
 * @description:
 * @date :2021/11/11 0011 下午 1:10
 *
 */
class CommentsModel : BaseModel() {
    fun requestComments(
        id : Int,
        itemId:Long,
        pageCount:Int,
        userId:Int
    ): Observable<BaseEntity>?{
        val comments: Observable<CommentsEntity> =
            ApiServer.instance().getRetrofit()!!.create(Api::class.java)
                .requestComments(id, itemId, pageCount, userId)
        return changeFun(comments)
    }
    fun requestaddComments(
         commentText:String,
         height:Int,
         image_url:String,
         itemId1:Long,
         userId1:Int,
         video_url:String,
         width:Int
    ): Observable<BaseEntity>?{
        val comments: Observable<AddCommentsEntity> =
            ApiServer.instance().getRetrofit()!!.create(Api::class.java)
                .requestaddComments(commentText, height, image_url, itemId1, userId1, video_url, width)
        return changeFun(comments)
    }

}